package com.dwy2002.course;

import com.dwy2002.common.Result;
import com.dwy2002.course.service.ICourseEnrollmentService;
import com.dwy2002.pojo.vo.courses.CoursesVO;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 杜伟毅
 * @version 1.0
 * @since 2025/04/02
 */
@RestController
@RequestMapping("/enrollment")
@RequiredArgsConstructor
public class CourseEnrollmentController {
    private final ICourseEnrollmentService service;

    /**
     * 返回用户全部报名课程
     *
     * @author 杜伟毅
     * @since 2025/4/4 0004 17:38
     */
    @GetMapping("/me/enrollments")
    public Result<List<CoursesVO>> getUserEnrollments() {
        return service.getUserEnrollments();
    }
}
